﻿<Window x:Class="AlgorithmBox.MainWindow"
				xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
				xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
				xmlns:my="clr-namespace:AlgorithmBox.FlowCharts"
				Title="MainWindow"
				Width="1024"
				Height="700"
				WindowStartupLocation="CenterScreen"
				SizeChanged="Window_SizeChanged"
				Loaded="Window_Loaded">
	<!--Window Resources-->
	<Window.Resources>

		<StackPanel x:Key="playButton"
								Orientation="Horizontal">
			<Polygon Points="0,0 0,15, 15,7.5"
							 Fill="Green" />
			<TextBlock Text="Run"
								 Margin="2,0" />
		</StackPanel>
		<StackPanel x:Key="stopButton"
								Orientation="Horizontal">
			<Polygon Points="0,0 0,15, 15,15 15,0"
							 Fill="Red" />
			<TextBlock Text="Stop"
								 Margin="2,0" />
		</StackPanel>
	</Window.Resources>
	<!--Window Resources-->

	<DockPanel x:Name="dock"
						 LastChildFill="True">

		<!--Menu Bar-->
		<Menu DockPanel.Dock="Top">
			<MenuItem Header="File">
				<MenuItem Header="New" />
				<MenuItem Header="Save"
									Click="Save_Click" />
				<MenuItem Header="Open"
									Click="Open_Click" />
			</MenuItem>
		</Menu>
		<!--Menu Bar-->

		<!--Tool Bar-->
		<ToolBar DockPanel.Dock="Top"
						 HorizontalAlignment="Left">
			<ToggleButton x:Name="startButton"
										Content="{StaticResource playButton}"
										Width="50"
										Click="play_Toogled" />
			<Button x:Name="nextButton"
							Content="Next"
							IsEnabled="False"
							Click="next_Clicked" />
		</ToolBar>
		<!--Tool Bar-->

		<!--Console-->
		<Expander DockPanel.Dock="Bottom"
							IsExpanded="True"
							ExpandDirection="Down"
							Background="WhiteSmoke"
							Header="Console I/O"
							Margin="5">
			<Border BorderThickness="1"
							BorderBrush="Black">
				<StackPanel>
					<ListBox x:Name="textConsoleIO"
									 Height="70" />
					<TextBox x:Name="textDeveloperConsole"
									 FontSize="14"
									 KeyDown="DeveloperConsole_KeyDown" />
				</StackPanel>
			</Border>
		</Expander>
		<!--Console-->

		<!--FlowChart Elements-->
		<Expander DockPanel.Dock="Left"
							IsExpanded="True"
							ExpandDirection="Left"
							Background="WhiteSmoke"
							Margin="5"
							FlowDirection="LeftToRight">
			<Expander.Header>
				<TextBlock Text="FlowChart Elements">
					<TextBlock.LayoutTransform>
						<RotateTransform Angle="-90" />
					</TextBlock.LayoutTransform>
				</TextBlock>
			</Expander.Header>

			<ListBox x:Name="listBoxFlowElements"
							 Width="120"
							 ScrollViewer.CanContentScroll="False"
							 Background="MintCream"
							 SelectionChanged="ListBoxFlowChartElements_SelectionChanged"
							 PreviewMouseDown="listBoxFlowElements_PreviewMouseDown">
				<ListBox.ItemContainerStyle>
					<Style TargetType="ListBoxItem">
						<Setter Property="Padding"
										Value="5" />
					</Style>
				</ListBox.ItemContainerStyle>
				<ListBox.ItemTemplate>
					<DataTemplate>
						<Grid Width="105">
							<ContentPresenter Content="{Binding}" />
						</Grid>
					</DataTemplate>
				</ListBox.ItemTemplate>

				<!--ListBox FlowChartElements-->
				<my:Process IsEnabled="False"
										Text="Process" />
				<my:Decision IsEnabled="False"
										 Text="Decision" />
				<my:Input IsEnabled="False"
									Text="Input"
									Width="80"
									Margin="10,0" />
				<my:Connector />
				<!--ListBox FlowChartElements-->
			</ListBox>
		</Expander>
		<!--FlowChart Elements-->


		<!--Variable List-->
		<Expander DockPanel.Dock="Right"
							IsExpanded="True"
							ExpandDirection="Right"
							Background="WhiteSmoke"
							Margin="5">
			<Expander.Header>
				<TextBlock Text="Variables">
					<TextBlock.LayoutTransform>
						<RotateTransform Angle="90" />
					</TextBlock.LayoutTransform>
				</TextBlock>
			</Expander.Header>

			<DockPanel>
				
				
				<StackPanel DockPanel.Dock="Bottom"
					Orientation="Horizontal">
					<Button Content="+"
									Margin="5"
									Width="50"
									Click="addNewVar_Click"/>
					<Button Content="-"
									Margin="5"
									Width="50"
									Click="removeVar_Click"/>
				</StackPanel>
				
				<ListView x:Name="listVariables">
					<ListView.View>
						<GridView>
							<GridViewColumn Header="Name"
															Width="90">
								<GridViewColumn.CellTemplate>
									<DataTemplate>
										<TextBox Width="78"
														 Text="{Binding Name}"/>
									</DataTemplate>
								</GridViewColumn.CellTemplate>
							</GridViewColumn>

							<GridViewColumn Header="Type"
															Width="75">
								<GridViewColumn.CellTemplate>
									<DataTemplate>
										<ComboBox x:Name="itemType"
															Width="63"
															Text="{Binding Type}"
															SelectedIndex="{Binding TypeIndex}">
											<ComboBoxItem>bool</ComboBoxItem>
											<ComboBoxItem>byte</ComboBoxItem>
											<ComboBoxItem>sbyte</ComboBoxItem>
											<ComboBoxItem>short</ComboBoxItem>
											<ComboBoxItem>ushort</ComboBoxItem>
											<ComboBoxItem>int</ComboBoxItem>
											<ComboBoxItem>uint</ComboBoxItem>
											<ComboBoxItem>long</ComboBoxItem>
											<ComboBoxItem>ulong</ComboBoxItem>
											<ComboBoxItem>float</ComboBoxItem>
											<ComboBoxItem>double</ComboBoxItem>
											<ComboBoxItem>decimal</ComboBoxItem>
											<ComboBoxItem>char</ComboBoxItem>
											<ComboBoxItem>string</ComboBoxItem>
										</ComboBox>
									</DataTemplate>
								</GridViewColumn.CellTemplate>
							</GridViewColumn>

						</GridView>
					</ListView.View>
				</ListView>
			</DockPanel>
		</Expander>
		<!--Variable List-->


		<my:FlowChart x:Name="flowChart"
									Margin="5" />
	</DockPanel>
</Window>
